﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="pragma" content="no-cache"/>   
<meta http-equiv="Cache-Control" content="no-cache, must-revadivdate"/>   
<meta http-equiv="expires" content="0"/> 
<script language="JavaScript" src="/euc/page/js/jquery.js"></script>
<title></title>
<script type="text/javascript">
	function refreshLeft(data){
		//alert(JSON.stringify(data));
		document.getElementById("leftFrame").contentWindow.refreshMenu(data);
	}
	
	var count = true;
	function load(){
		if(count == false){
			$("#topframeset").prop('rows','88,*,0');
			$('#iframeID').attr('src', $('#iframeID').attr('src'));
			count = true;
		}
	}
	
	function swichSystem(){		
		$("#topframeset").prop('rows','0,0,*');
		count = false;
	}
	
	function getScreenToken(){
		var url = "http://www.thethinking.cc/pvgi/home/mainpage?token=";
		$.ajax({
	        url: '/euc/system/screen/token',
	        data:'',
	        beforeSend: function(request) {
	        	var accessToken = localStorage.getItem('accessToken');
	            request.setRequestHeader("accessToken",accessToken );
	        },
	        dataType: 'JSON',
	        async: true,
	        contentType:'application/json;charset=utf-8',
	        type: 'POST',
	        success: function (result, textStatus, response) {
	        	console.log(JSON.stringify(result));
	        	if(result.status == '0'){
	        		$('#iframeID').attr('src', url+result.data);
	        	}	        	
	        },
	        error: function () {
	        	console.log(e.message);
	        }  
	    });
	}	
	getScreenToken();
	
	
	//客户列表跳到财务帐单操作
	function gotoBillPage(clientName){
		try{
			var hasFinance = document.getElementById("topFrame").contentWindow.checkFinance();
			if(hasFinance == 0){
				alert("你没有帐单列表权限！");
				return;
			}
			localStorage.setItem('clientName',clientName);
			document.getElementById("leftFrame").contentWindow.swithMenul('4200','4210');
		}catch(e){
			console.log(e.message);
		}
	}
	
	
	//客户列表跳到会员中心
	function gotoMemberPage(clientName){
		try{
			localStorage.setItem('clientName',clientName);
			document.getElementById("leftFrame").contentWindow.swithMenul('2200','2210');
		}catch(e){
			console.log(e.message);
		}
	}
	
	
	//个人客户新建完合同后跳到签约客户
	function gotoSignCustomersPage(orderId,clientName){
		try{
			localStorage.setItem('orderId',orderId);
			localStorage.setItem('clientName',clientName);
			document.getElementById("leftFrame").contentWindow.swithSignCustomer('1100','1130');
		}catch(e){
			console.log(e.message);
		}
	}
	
	
	//跳转到消息 通知
	function gotoMessageNotice(){
		try{
			var hasPermission  = document.getElementById("topFrame").contentWindow.checkPermission('80000','8110');
			if(hasPermission == 0){
				return;
			}
			document.getElementById("leftFrame").contentWindow.swithFirstMenul('8100','8110');
		}catch(e){
			console.log(e.message);
		}
	}
	
	//跳转到消息 通知
	function refreshMessage(){
		try{
			var hasPermission  = document.getElementById("topFrame").contentWindow.refreshMessage();
		}catch(e){
			console.log(e.message);
		}
	}
	
</script>    
</head>
<frameset rows="88,*,0" cols="*" frameborder="no" border="0" framespacing="0" id='topframeset'>
  <frame src="top.html" name="topFrame" scrolling="no" noresize="noresize" id="topFrame" title="topFrame" />
  <frameset cols="187,*" frameborder="no" border="0" framespacing="0">
    <frame src="left.html" name="leftFrame" id="leftFrame" scrolling="no" noresize="noresize" id="leftFrame" title="leftFrame" />
    <frame src="index.html" name="rightFrame" id="rightFrame" title="rightFrame" />
  </frameset>
	<frame onload="load();" id="iframeID" name="rightFrame" id="rightFrame" title="rightFrame" 
  		style="width:100%;height:400px;"  frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no" allowtransparency="yes"
		src="" >
	<frame>
</frameset>
<noframes>
<body>
	要不咱换个浏览器试一下！
</body>
</noframes>
</html>		
